#include "voicemessageevent.h"
#include "converse/converseabstractconversation.h"
#include "converse/conversevoicemessage.h"
#include "converse/conversemanager.h"
#include "messageevent.h"
#include "appchat/accountmanager.h"


VoiceMessageEvent::VoiceMessageEvent(qint64 id,
                                     qint64 sendingId,
                                     qint64 conversationId,
                                     qint64 createdTime,
                                     qint64 senderId,
                                     qint64 receiverId,
                                     const QString &text,
                                     QObject *parent)
    : MessageEvent(id,
                   sendingId,
                   conversationId,
                   createdTime,
                   senderId,
                   receiverId,
                   parent)
    , m_text(text)
{
}


MessageEvent::MessageEventType
VoiceMessageEvent::messageEventType() const
{
    return MessageEvent::VoiceMessageEvent;
}


Converse::AbstractMessage *
VoiceMessageEvent::createMessage(const Converse::AbstractConversation &conversation,
                                 QObject *parent) const
{
    return new Converse::VoiceMessage(id(),
                                      sendingId(),
                                      conversation,
                                      createdTime(),
                                      createdTime(),
                                      senderId(),
                                      receiverId(),
                                      text(),
                                      parent);
}
